package com.yuyu.shop.domain.order.repository;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuyu.shop.domain.order.DO.OrderDO;


/**
 * @author
 * @description: 订单接口
 * @date: 2022/8/3 10:17
 */
public interface OrderRepository {

    /**
     * 用id获取order
     * @param id
     * @return OrderDO
     */
    OrderDO getById(Long id);

    /**
     * 用orderId获取order
     * @param orderId
     * @return OrderDO
     */
    OrderDO getByOrderId(String orderId);


    /**
     * 用userId来查询所有订单
     * @param userId
     * @param type 0.全部订单 1.代发货  2.已发货 3.完成订单 4.退款订单
     * @param current
     * @param pageSize
     * @return
     */
    Page<OrderDO> getByUserId(Long userId, Integer type, Long current, Long pageSize);


    /**
     * 修改一个订单
     * @param orderDO
     * @return OrderDO
     */
    Boolean updateById(OrderDO orderDO);


    /**
     * 用orderId来删除一个订单
     * @param orderId
     * @return
     */
    Boolean delete(String orderId);

    /**
     * 新增一个订单
     * @param orderDO
     * @return OrderDO
     */
    Boolean insert(OrderDO orderDO);

}
